package BaseClass;

public class User {

    private String userID;
    private String userName;
    private String password;
    private String email;
    private String address;
    private String phoneNumber;
    private String power;

    public User() {
    }

    public User(String userID, String password) {
        this.userID = userID;
        this.password = password;
    }

    public User(String userID, String userName, String password, String email, String address, String phoneNumber, String power) {
        this.userID = userID;
        this.userName = userName;
        this.password = password;
        this.email = email;
        this.address = address;
        this.phoneNumber = phoneNumber;
        this.power = power;
    }

    public void setUser(String userID, String userName, String password, String email, String address, String phoneNumber, String power) {
        this.userID = userID;
        this.userName = userName;
        this.password = password;
        this.email = email;
        this.address = address;
        this.phoneNumber = phoneNumber;
        this.power = power;
    }

    /**
     * String userID, String userName, String password, String email, String address, String phoneNumber, String power.
     * @return String userID, String userName, String password, String email, String address, String phoneNumber, String power.
     */
    public Object[] getUserAttributeList() {
        Object[] list = new Object[7];
        list[0] = userID;
        list[1] = userName;
        list[2] = password;
        list[3] = email;
        list[4] = address;
        list[5] = phoneNumber;
        list[6] = power;
        return list;
    }

    /**
     * String userID, String userName, String password, String email, String address, String phoneNumber, String power.
     * @param list String userID, String userName, String password, String email, String address, String phoneNumber, String power.
     * @return true or false.
     */
    public boolean setUserAttributeList(Object[] list) {
        if (list.length == 7) {
            this.setUserID((String) list[0]);
            this.setUserName((String) list[1]);
            this.setPassword((String) list[2]);
            this.setEmail((String)list[3]);
            this.setAddress((String)list[4]);
            this.setPhoneNumber((String)list[5]);
            this.setPower((String)list[6]);
            return true;
        } else {
            return false;
        }
    }


    public User getNewUser() {
        User newUser = new User();
        newUser.setUserID(this.userID);
        newUser.setUserName(this.userName);
        newUser.setPassword(this.password);
        newUser.setEmail(this.email);
        newUser.setAddress(this.address);
        newUser.setPhoneNumber(this.phoneNumber);
        newUser.setPower(this.power);
        return newUser;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }


    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getPower() {
        return power;
    }

    public void setPower(String power) {
        this.power = power;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    @Override
    public String toString() {
        return "User{" +
                "userID='" + userID + '\'' +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", address='" + address + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", power='" + power + '\'' +
                '}';
    }


}
